package cn.edu.hy.controller;

import cn.edu.hy.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("test")
public class TestController {

    private TestService testService;

    @Autowired
    public void setTestService(TestService testService) {
        this.testService = testService;
    }

    @GetMapping("index")
    public ModelAndView index(ModelMap modelMap){

        modelMap.put("countList",testService.findList());

        return new ModelAndView("test/index",modelMap);
    }

}
